/*
 * Date.h
 *
 *	Class to hold Date Objects, and utility functions for calculating date difference in years etc.,
 *
 *  Created on: Sep 29, 2009
 *      Author: karthik
 */

#ifndef DATE_H_
#define DATE_H_

#include<time.h>
#include<string>
#include "Utils.h"

class Date {

public:
	int day;					//	day
	int month;					//	month
	int year;					//	year
	time_t date;				//	time_t object holding the date information.

	void initialize(int x, int y, int z);	//	Initializes the Date object with given date, month, year values.
	std::string toString();		//	Returns the Date in string format.
	Date();						//	Default Constructor
	Date(std::string mmddyy);	//	Constructs Date Object from a string of mmddyy format.
	Date(int d, int m, int y){initialize(d, m, y);};	//	Constructs Date Object from a d(date), m(month), y(year).
	virtual ~Date();			//	Default Destructor

};


//	Returns difference in no of years between the two Date Objects passed.
double time_diff_yrs(const Date& time1, const Date& time2);

#endif /* DATE_H_ */
